{% extends "base_generic.html" %}
{% block script %}
<script type="text/javascript">
function generateUrl(name) {
  var sanitizedName = string_to_slug(name);
  $("#url").val(sanitizedName);
}

</script>
{% endblock %}
{% block content %}
	<h1>Film</h1>
<form name="edit-admin" id="edit-admin" method="post" action="{{path}}">
<div class="field">
<label for="name">Name:</label>
<input type="text" name="name" id="name" value="{{person.name}}" onblur="generateUrl($('#name').val())" />
</div>
<div class="field">
<label for="url">URLs:</label>
<input type="text" name="url" id="url" value="{{person.url}}" />
</div>
<div class="field">
<label for="genre">Role:</label>
{% for arole in roles %}
{% if forloop.first %}
<select name="role" id="role">
{% endif %}
<option value="{{arole.key}}" {% ifequal arole.name person.role.name %}selected="selected"{% endifequal %}>{{arole.name}}</option>
{% if forloop.last %}
</select>
{% endif %}
{% endfor %}
</div>
<div style="clear:both" class="field">
<label for="description">Description:</label>
<textarea name="description" rows="5" cols="45" id="description">{{film.description}}</textarea>
</div>
</div><br class="clear" />
<input type="submit" name="save" class="mainbutton" id="publish" value="Save" />
<input type="hidden" name="codenum" id="codenum" value="{{filekey}}" />
<br class="clear" />
</form>
{% endblock %}
